<?php

namespace app\common\validate\Hotel;

// 引入Thinkphp底层的验证器
use think\Validate;

/**
 * 定义房间验证器
 */
class Room extends Validate{
    // 设置我们要验证的字段规则
    protected $rule = [
        'name' => ['require'],
        'price' => ['require'],
        'total' => ['require'],
        'live' => ['require'],
        'area' => ['require'],
    ];

    /**
     * 设置错误的提示信息
     */
    protected $message = [
        'name.require' => '房间名必填',
        'price.require' => '价格必填',
        'total.require' => '房间数量必填',
        'live.require' => '居住人数必填',
        'area.require' => '房间面积必填'
    ];

    /**
     * 设置验证器的场景
     */
    protected $scene = [
    ];
}

?>
